<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript" src="<s:url value="/js/safety.js"/>"></script>

<div id="filter">
    <s:form id="form" cssClass="tableShow" style="margin-bottom: 5%;">
        <tr>
            <td >Sent:</td>
        </tr>
        <tr>
            <td style="padding-left: 10px; font-weight: normal;"><s:date name="safetydocs.fecha" format="dd-MMM-yy HH:mm" /></td>
        </tr>
        <tr>
            <td >Drug:</td>
        </tr>
        <tr>
            <td style="padding-left: 10px; font-weight: normal;"><s:property value="%{safetydocs.droga.drugName}"/></td>
        </tr>
        <tr>
            <td>Countries:</td>
        </tr>
        <tr>
            <td style="padding-left: 10px; font-weight: normal;">
                <s:iterator value="%{safetydocs.countries}" var="pais" status="stat">
                    <s:property value="%{#pais.country}"/><s:if test="#stat.last == false"> - </s:if>
                </s:iterator>
            </td>
        </tr>

            <tr>
                <td>Roles:</td>
            </tr>
            <tr>
                <td colspan="2" style="padding-left: 10px; font-weight: normal;">
                    <s:if test="%{safetydocs.sentToPpalInv == true}">
                        Principal Investigator
                        <s:if test="%{safetydocs.sentToSubInv == true || !safetydocs.roles.isEmpty()}">
                             -
                        </s:if>
                    </s:if>
                    <s:if test="%{safetydocs.sentToSubInv == true}">
                        Sub-Investigator
                        <s:if test="%{!safetydocs.roles.isEmpty()}">
                            -
                        </s:if>
                    </s:if>
                    <s:iterator value="%{safetydocs.roles}" var="role" status="stat">
                        <s:property value="%{#role.descripcion}"/><s:if test="#stat.last == false"> - </s:if>
                    </s:iterator>
                </td>
            </tr>
            <tr>
                <td>Body comment:</td>
            </tr>
            <tr>
                <td style="padding-left: 10px; font-weight: normal;"><s:property value="%{safetydocs.envioses[0].comment}"/></td></td>
            </tr>
            <tr>
                <td>Documents:</td>
            </tr>
            <s:iterator value="safetydocs.envioses" status="status" var="envio">
                <s:if test="#status.first == false">
                    <tr>
                        <td style="padding-left: 10px; font-weight: normal;"><s:property value="%{#envio.name}"/> (<s:property value="%{#envio.type}"/>)</td>
                    </tr>
                </s:if>
            </s:iterator>

        <tr>
            <td >Sent to:</td>
        </tr>
            <s:iterator value="safetydocs.recipients" var="recip">
                <tr>
                    <td style="padding-left: 10px; font-weight: normal;"><s:property value="%{#recip.name}"/> <s:property value="%{#recip.surname}"/></td>
                    <td style="padding-left: 10px; font-weight: normal;"><a style="text-decoration: underline; color : blue" href='mailto:<s:property value="%{#recip.email}"/>'><s:property value="%{#recip.email}"/></a></td>
                </tr>
            </s:iterator>
        <tr>
            <td colspan="2" class="centeredButtons" ><a style="text-align: right" onclick="closeSafety()"><img class="buttonSend" src="<s:url value="/images/b_back.png"/>" alt="Back"></a>
            </td>
        </tr>

    </s:form>

</div>